<!doctype html>

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name='gwt:property' content='locale=en'>

    <title>Yui4Gwt example gallery</title>
    <script type="text/javascript" language="javascript" 
    	src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
  </head>
  <body class="yui3-skin-sam">
<div id="demo" class="yui3-skin-sam">
  <label for="ac-input">Enter the name of a US state:</label><br>
  <input id="ac-input" type="text">
</div>
<script type="text/javascript">
YUI().use('autocomplete', 'autocomplete-filters', 'autocomplete-highlighters', function (Y) {
	  var states = [
	    'Alabama',
	    'Alaska',
	    'Arizona',
	    'Arkansas',
	    'California',
	    'Colorado',
	    'Connecticut',
	    'Delaware',
	    'Florida',
	    'Georgia',
	    'Hawaii',
	    'Idaho',
	    'Illinois',
	    'Indiana',
	    'Iowa',
	    'Kansas',
	    'Kentucky',
	    'Louisiana',
	    'Maine',
	    'Maryland',
	    'Massachusetts',
	    'Michigan',
	    'Minnesota',
	    'Mississippi',
	    'Missouri',
	    'Montana',
	    'Nebraska',
	    'Nevada',
	    'New Hampshire',
	    'New Jersey',
	    'New Mexico',
	    'New York',
	    'North Dakota',
	    'North Carolina',
	    'Ohio',
	    'Oklahoma',
	    'Oregon',
	    'Pennsylvania',
	    'Rhode Island',
	    'South Carolina',
	    'South Dakota',
	    'Tennessee',
	    'Texas',
	    'Utah',
	    'Vermont',
	    'Virginia',
	    'Washington',
	    'West Virginia',
	    'Wisconsin',
	    'Wyoming'
	  ];

// 	  var ac = new Y.AutoComplete({
// 		  resultFilters : 'phraseMatch', 
// 		  resultHighlighter: 'phraseMatch', 
// 		  source: states, 
// 		  inputNode : Y.one('#ac-input')
// 	  }); 

var ac = new Y.AutoComplete({
  inputNode: '#ac-input',
  source: states
});

ac.on("select", function(ev){
	alert("selected");
	return true; 
}); 


	  
// 	  Y.one('#ac-input').plug(Y.Plugin.AutoComplete, {
// 	    resultFilters    : 'phraseMatch',
// 	    resultHighlighter: 'phraseMatch',
// 	    source           : states
// 	  });
	});
</script>

  </body>
</html>
